package com.xxx.corejava.day1216;

import javax.swing.*;
import java.awt.*;

public class TestGridLayout {

    public static void main(String[] args) {
        JFrame jf=new JFrame();

        jf.setLayout(new GridLayout(4,5));

        for (int i = 0; i < 20; i++) {
            jf.add(new JButton("按钮"+i));
        }

        jf.setSize(400,300);
        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

}
